package com.sunwayhorizo.health.hl7.persistent;

import com.sunwayhorizo.health.hl7.persistent.pk.RimCoreEntyAddrUsesPK;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


@Entity
//@NamedQuery(name = "EntyAddrUses.findAll",     query = "select o from EntyAddrUses o")
@Table(name = "RIM_CORE_ENTY_ADDR_USES")
@IdClass(RimCoreEntyAddrUsesPK.class)
public class RimCoreEntyAddrUses implements Serializable {
    @Id
    @Column(name="ENTITY_ID", nullable = false, insertable = false, updatable = false)    private Long entityId;
    @Id
    @Column(name="ENTITY_VERSION_NUM", nullable = false, insertable = false, updatable = false)    private Long entityVersionNum;
    @Id
    @Column(name="ADDRESS_ID", nullable = false, insertable = false, updatable = false)    private Long addressId;
    @Id
    @Column(name="ADDRESS_USE_CODE", nullable = false)    private String use;
    
    @Column(name="PARTY_SITE_USE_ID")    private Long partySiteUseId;
    
    @ManyToOne
    @JoinColumns({
    @JoinColumn(name = "ENTITY_ID", referencedColumnName = "ENTITY_ID"),
    @JoinColumn(name = "ENTITY_VERSION_NUM", referencedColumnName = "ENTITY_VERSION_NUM"),
    @JoinColumn(name = "ADDRESS_ID", referencedColumnName = "ADDRESS_ID")
    })
    private RimCoreEntyAddrs rimCoreEntyAddrs;

    public RimCoreEntyAddrUses() {
        
    }

    public Long getAddressId() {
        return addressId;
    }

    public void setAddressId(Long addressId) {
        this.addressId = addressId;
    }

    public Long getEntityId() {
        return entityId;
    }

    public void setEntityId(Long entityId) {
        this.entityId = entityId;
    }

    public Long getEntityVersionNum() {
        return entityVersionNum;
    }

    public void setEntityVersionNum(Long entityVersionNum) {
        this.entityVersionNum = entityVersionNum;
    }

    public Long getPartySiteUseId() {
        return partySiteUseId;
    }

    public void setPartySiteUseId(Long partySiteUseId) {
        this.partySiteUseId = partySiteUseId;
    }

    public void setUse(String use) {
        this.use = use;
    }

    public String getUse() {
        return use;
    }

    public void setRimCoreEntyAddrs(RimCoreEntyAddrs rimCoreEntyAddrs) {
        this.rimCoreEntyAddrs = rimCoreEntyAddrs;
    }

    public RimCoreEntyAddrs getRimCoreEntyAddrs() {
        return rimCoreEntyAddrs;
    }
}
